package com.yang.design.create.factory.abstractfactory1;

import lombok.Getter;

@Getter
public class Client {
    private GoodsA goodsA;
    private GoodsB goodsB;
    private AbstractFactory factory;

    public Client(AbstractFactory factory) {
        this.goodsA = factory.getInstanceA();
        this.goodsB = factory.getInstanceB();
    }

    public static void main(String[] args) {
        Client client = new Client(new Factory1());
        GoodsB goods = client.getGoodsB();
        goods.method();
    }
}
